using System;
using System.Collections.Generic;
using System.Text;

using NHibernate;
using Framework.Library.Domain;
using Framework.Library.Base;

namespace Framework.Library.DAO
{
    public partial interface IPortalTabcontrolManager : IManagerBase<PortalTabcontrol, int>
    {
		// Get Methods
		IList<PortalTabcontrol> GetByControlID(System.Int32 controlID);
		IList<PortalTabcontrol> GetByTabID(System.Int32 tabID);
    }

    partial class PortalTabcontrolManager : ManagerBase<PortalTabcontrol, int>, IPortalTabcontrolManager
    {
		#region Constructors
		
		public PortalTabcontrolManager() : base()
        {
        }
        public PortalTabcontrolManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<PortalTabcontrol> GetByControlID(System.Int32 controlID)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(PortalTabcontrol));
			
			ICriteria portalModulecontrolCriteria = criteria.CreateCriteria("PortalModulecontrol");
            portalModulecontrolCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", controlID));
			
			return criteria.List<PortalTabcontrol>();
        }
		
		public IList<PortalTabcontrol> GetByTabID(System.Int32 tabID)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(PortalTabcontrol));
			
			ICriteria portalTabCriteria = criteria.CreateCriteria("PortalTab");
            portalTabCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", tabID));
			
			return criteria.List<PortalTabcontrol>();
        }
		
		#endregion
    }
}